package com.itproject.idgenerator.yitter;

import com.github.yitter.contract.IdGeneratorOptions;
import com.github.yitter.idgen.YitIdHelper;

public class YitterTest {

    //1-漂移算法，2-传统算法
    final static short method = 1;


    public static void main(String[] args) {
        IdGeneratorOptions options = new IdGeneratorOptions();
        options.Method = method;
        options.WorkerId = 1;

        // 测试一下 IdHelper 方法，获取单个Id
        YitIdHelper.setIdGenerator(options);
        long newId = YitIdHelper.nextId();
        System.out.println("=====================================");
        System.out.println("这是用方法 " + method + " 生成的 Id：" + newId);
    }
}

// mvn clean deploy -P release